package com.thiny.android.game.thunderbolt.thread;

import com.thiny.android.game.thunderbolt.util.Constants;
import com.thiny.android.game.thunderbolt.view.GameView;

public class GameViewThread extends Thread {

	private GameView mGameView;
 
	
	// 控制线程的循环
	private boolean mFlag = true;

	public GameViewThread(GameView gameView) {
		mGameView = gameView; 
	}

	public void setFlag(boolean flag) {
		this.mFlag = flag;
	}

	@Override
	public void run() {

		while (mFlag) {
 
			mGameView.draw();
			try {
				Thread.sleep(Constants.REFLESH_TIME);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}

	}

}
